package businesslogic.user;

import java.rmi.RemoteException;
import java.util.ArrayList;

import dataService.userDataService.UserDataService;
import useDatabase.java.updateTable;
import vo.Limitation;
import vo.uservo.ChangePasswordVO;
import Enum.Factor;
import Enum.ResultMessage;
import businesslogicservice.userblservice.ChangePasswordBLService;

public class ChangePassword implements ChangePasswordBLService{
	
	ChangePasswordVO vo;
	
	public ChangePassword(ChangePasswordVO changePasswordVO){
		vo=changePasswordVO;
	}

	@Override
	public ResultMessage setNewPassword() {
		UserDataService userDataService=new UserDataService();
		ArrayList<Limitation> limit=new ArrayList<Limitation>();
		limit.add(new Limitation(Factor.UserID, vo.getUserID().toString()));
		userDataService.changePassword(limit, vo.getNewPassword());
		return null;
	}
}
